package com.lx.test.service;

import org.apache.dubbo.common.URL;
import org.apache.dubbo.config.annotation.Service;
import org.apache.dubbo.rpc.RpcContext;

/**
 * @author wcy
 */
@Service(version = "default")
public class DefaultDemoServiceImpl implements DemoService {
    @Override
    public String sayHello(String name) {

        URL url = RpcContext.getContext().getUrl();
        return String.format("%s：%s, Hello, %s", url.getProtocol(), url.getPort(), "hello"+name);  // 正常访问
    }
}
